<?php

use think\migration\Seeder;
use think\facade\Db;

class SupplyUser extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        try {
			$userData = $this->getuserData();
			Db::name('supply_user')->insertAll($userData);
        } catch (\Throwable $th) {
            return json($th->getMessage());
        }
    }

    protected function getuserData()
    {
        $arr = [
            [
                'openid' => 'op3kL6OLfBtxRc1pB0dnBgaz-shA',
                'grade'  => 1,
                'nickname' => '聂哥',
                'head_img' => '1.png'
            ],
            [
                'openid' => 'op3kL6K10cZs2yPFt8RHdLOfqycw',
                'grade'  => 1,
                'nickname' => '小明',
                'head_img' => '1.png'
            ],
        ];

        return $arr;
    }
}